package com.bianguo.android.baidumapdemo;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * Created by Administrator on 2018/2/28.
 */

public abstract class BaseActivity extends AppCompatActivity {

    private Unbinder unBind;
    protected Activity mContext;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mContext = this;
        setContentView(layoutId());
        unBind = ButterKnife.bind(this);
        initView(savedInstanceState);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        unBind.unbind();
    }

    protected abstract int layoutId();

    protected abstract void initView(@Nullable Bundle saveInstanceState);
}
